package com.jrzh.mvc.convert.sys;

import com.jrzh.framework.base.convert.BaseConvertI;
import com.jrzh.common.exception.ProjectException;
import com.jrzh.mvc.model.sys.EmailSendingModel;
import com.jrzh.mvc.view.sys.EmailSendingView;
import com.jrzh.common.utils.ReflectUtils;

public class EmailSendingConvert implements BaseConvertI<EmailSendingModel, EmailSendingView> {

	@Override
	public EmailSendingModel addConvert(EmailSendingView view) throws ProjectException {
		EmailSendingModel model = new EmailSendingModel();
		ReflectUtils.copySameFieldToTarget(view, model);
		return model;
	}

	@Override
	public EmailSendingModel editConvert(EmailSendingView view, EmailSendingModel model) throws ProjectException {
		ReflectUtils.copySameFieldToTargetFilter(view, model, new String[]{"createBy", "createTime"});
		return model;
	}

	@Override
	public EmailSendingView convertToView(EmailSendingModel model) throws ProjectException {
		EmailSendingView view = new EmailSendingView();
		ReflectUtils.copySameFieldToTarget(model, view);
		return view;
	}

}
